<template>
	<view class="uni-tab-bar">
		<view id="tab-bar" class="uni-swiper-tab">
			<view v-for="(tab,index) in tabBars" :key="tab.id" class="swiper-tab-list" :class="tabIndex==index ? 'active' : ''"
			 :id="tab.id" :data-current="index" @click="tapTab">{{tab.name}}</view>
		</view>
	</view>
</template>
<script>

	const tpl = {

	};

	export default {

		data() {
			return {
				tabIndex: 0,
				tabBars: [{
					name: '展示收入',
					id: 'guanzhu'
				}, {
					name: '采集收入',
					id: 'tuijian'
				}, {
					name: '购买收入',
					id: 'tiyu'
				}]
			}
		},
		onLoad() {
			
		},
		methods: {

			loadMore(e) {
				setTimeout(() => {
					this.addData(e);
				}, 1200);
			},


			tapTab(e) { //点击tab-bar
				let tabIndex = e.target.dataset.current;
				// if (this.newsitems[tabIndex].data.length === 0) {
				// 	this.addData(tabIndex)
				// }

			},

		}
	}
</script>

<style>
	.uni-tab-bar-loading {
		text-align: center;
		font-size: 28upx;
		color: #999;
	}
	.swiper-tab-list{
		width: 33%;
	}
	.test{
		width: 100upx;
		height: 200upx;
		background-color: #007AFF;
	}
	.swiper-box{
		width: 100%;
		height: 100%;
	}
</style>
